package com.wyzz.hr.pojo.base;

import java.io.Serializable;

import com.wyzz.hr.pojo.Backup;

public abstract class BaseBackup implements Serializable {

	public BaseBackup() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseBackup(String id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BaseBackup(String id, String fileName, Integer fileSize,
			String fileCreatTime) {
		hashCode = 0x80000000;
		setId(id);
		setFileName(fileName);
		setFileSize(fileSize);
		setFileCreatTime(fileCreatTime);
		initialize();
	}

	protected void initialize() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public Integer getFileSize() {
		return fileSize;
	}

	public void setFileSize(Integer fileSize) {
		this.fileSize = fileSize;
	}

	public String getFileCreatTime() {
		return fileCreatTime;
	}

	public void setFileCreatTime(String fileCreatTime) {
		this.fileCreatTime = fileCreatTime;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Backup))
			return false;
		Backup backup = (Backup) obj;
		if (null == getId() || null == backup.getId())
			return false;
		else
			return getId().equals(backup.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "Backup";
	public static String PROP_FILE_CREAT_TIME = "fileCreatTime";
	public static String PROP_FILE_NAME = "fileName";
	public static String PROP_ID = "id";
	public static String PROP_FILE_SIZE = "fileSize";
	private int hashCode;
	private String id;
	private String fileName;
	private Integer fileSize;
	private String fileCreatTime;

}
